<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <base href="" />
    <title>eTaxware : <?php echo $data['site_name']; ?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" href="assets/css/bootstrap.css" type="text/css" charset="utf-8">
	<script src="assets/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="assets/js/bootstrap.js"></script> 
	<script type="text/javascript" src="assets/js/accounting.min.js"></script>	
	<script type="text/javascript" src="assets/js/kasir.js"></script>	
		
<script type="text/javascript">

var row_i = 0 ;
var menu = new Array();
	menu = [{id:"G106",name :"Nasi Goreng",qty : 1,price : 30000.00,scharge :0.50,tax :10.00,discount : 0.50},
			{id:"G107",name :"Ikan Gurame",qty : 1,price : 100000.00,scharge :0.50,tax :10.00,discount : 0.50},
			{id:"G108",name :"Es Kelapa",qty : 1,price : 12500.00,scharge :0.50,tax :10.00,discount : 0.50}
		   ];



/*------------------ Utility Function ----------------------*/
function addquote(s){
 return "'"+s+"'";
}


/*-----------------------------------ON DOCUMENT READY--------------------------------*/
$(document).ready(function(){
var bill = new Bill();	
 /*add row */
	$('button[id="btn_addrow-1"]').click(function(){
		var btn_id = $(this).attr('id');
		var id     = btn_id.split("-");
		var obj  = {};
		//obj = objectFindByKey(menu,'id',id[1]);
	    //obj.qty = 1;
		//console.log(JSON.parse(JSON.stringify(obj)));
		
		bill.add_item({id:"G106",name :"Nasi Goreng",qty : 1,price : 30000.00,scharge :0.50,tax :10.00,discount : 0.50}); 
		//bill.add_item(obj);
	});
	
	
	$('button[id="btn_addrow-2"]').click(function(){
		var btn_id = $(this).attr('id');
		var id     = btn_id.split("-");
		var obj  = {};
		//obj = objectFindByKey(menu,'id',id[1]);
	    //obj.qty = 1;
		//console.log(JSON.parse(JSON.stringify(obj)));
		
		bill.add_item({id:"G107",name :"Ikan Gurame",qty : 1,price : 100000.00,scharge :0.50,tax :10.00,discount : 0.50}); 
		//bill.add_item(obj);
	});
	$('button[id="btn_addrow-3"]').click(function(){
		var btn_id = $(this).attr('id');
		var id     = btn_id.split("-");
		var obj  = {};
		//obj = objectFindByKey(menu,'id',id[1]);
	    //obj.qty = 1;
		//console.log(JSON.parse(JSON.stringify(obj)));
		
		bill.add_item({id:"G108",name :"Es Kelapa",qty : 1,price : 12500.00,scharge :0.50,tax :10.00,discount : 0.50}); 
		//bill.add_item(obj);
	});
	
  /*del row */
 	$("#tbl_sales").on("click",'button[id^="del-"]',function(){
		var delVAL=$(this).attr('value');
		var dl_val=delVAL.split("-");
		bill.remove_item(dl_val); 
	});
  
  /* Reset Bill Button*/
  $('button[id="btn_reset"]').click( function(){
		bill.reset(); 
	});

  
  
  
  
});





</script>
</head>
<body>
<p>
<button type="button" id="btn_addrow-1">Testing : Product 1</button>
<button type="button" id="btn_addrow-2">Testing : Product 2</button>
<button type="button" id="btn_addrow-3">Testing : Product 3</button>

<button type="button" id="btn_reset" >RESET BILL</button>


		<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="margin:5px 0 0 0;">
			<thead>
			<tr >
				<th style="width: 10%" >X</th>
				<th style="width: 50%">Product</th>		
				<th style="width: 20%">Qty</th>
				<th style="width: 20%">Price</th>
				
			</tr>
			</thead>	
        </table>


		<table width="100%" border="1" cellpadding="0" cellspacing="0"  id="tbl_sales" style="margin:0;">
		<tbody id="tbody_sales">
		</tbody>
		</table>
		
		<p><p><p>
		<!-- Panel TOTAL -->
		<table width="100%" border="2" cellpadding="0" cellspacing="0"  id="tbl_summary" style="margin:0;">
		<tbody>
		<tr><td style="width: 25%">Total Items</td><td id="t_items" style="width: 15%;text-align:right">0.00</td><td style="width: 25%">Total</td><td id="t_price" style="width: 15%;text-align:right">0.00</td>
		</tr>	
		<tr><td style="width: 25%">Tax</td><td id="t_tax" style="width: 15%;text-align:right">0.00</td><td style="width: 25%">S-Charge</td><td id="t_scharge" style="width: 15%;text-align:right">0.00</td>
		</tr>
		<tr><td style="width: 25%"></td><td style="width: 25%"></td><td style="width: 25%">Disc</td><td id="t_discount" style="width: 15%;text-align:right">0.00</td>
		</tr>
		<tr><td style="width: 25%"></td><td style="width: 25%"></td><td style="width: 25%">GRAND TOTAL</td><td id="t_grand" style="width: 15%;text-align:right"></td>
		</tr>
		</tbody>
		</table>


</body>
</html>